FlushVol
FlushVol Update disk with any unwritten data
#include <Files.h> File Manager
StringPtr volName ; address of Pascal-style name; NIL=use vRefNum
short vRefNum ; volume reference number
returns Error Code; 0=no error
FlushVol stores to disk all unwritten data currently in the volume buffer. It
should be called periodically (certainly after closing a file) to protect against
power loss or unexpected disk ejection.
volName is the address of a length-prefixed, pascal-style string containing
the name of the volume you wish to flush. If volName is NIL (0), the
vRefNum parameter will be used.
vRefNum is the reference number of the volume you wish to flush. This
parameter is used only if volName is invalid or NIL.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Invalid volName
extFSErr (-57) External file system
ioErr (-36) I/O error
nsvErr (-35) No such volume
paramErr (-50) No default volume

Notes: If volName is NIL and vRefNum is 0, the default volume is flushed (see
SetVol). If the volume buffer has not changed since the last call to
FlushVol, this function has no effect.
FlushVol is called automatically whenever a disk is ejected (Eject) or
unmounted (UnmountVol) or taken off-line (PBOffLine).
The PBFlushFile function can be used to flush the contents of a single file
to disk.